﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.CompilerServices;
using System.Text;
using System.Xml.Serialization;
using CommandLine;
using Newtonsoft.Json;

namespace my_console;

class Program3
{
    public void Main(string[] args)
    {
        // var ww = new Person
        // {
        //     Name = "孙小双",
        //     Age = 33
        // };
        // var xml = new XmlSerializer(ww.GetType());
        // var aa = new MemoryStream();
        // xml.Serialize(aa, ww);
        // var bb = new byte[aa.Length];
        // aa.Read(bb, 0, bb.Length);
        // var ss = Encoding.Default.GetString(bb);
        // System.Console.WriteLine(ss);

        // var ww = new C();
        // ww.Log("打印信息");

        Log("打印信息");
    }

    public static void Log(string msg,
        [CallerMemberName] string memberName = "",
        [CallerFilePath] string sourceFilePath = "",
        [CallerLineNumber] int sourceLineNumber = 0)
    {
        System.Console.WriteLine($"打印信息：{msg}, {memberName}, {sourceFilePath}, {sourceLineNumber}");
    }

}

public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }
}

class C
{
    public void Log(string msg,
        [CallerMemberName] string memberName = "",
        [CallerFilePath] string sourceFilePath = "",
        [CallerLineNumber] int sourceLineNumber = 0)
    {
        System.Console.WriteLine($"打印信息：{msg}, {memberName}, {sourceFilePath}, {sourceLineNumber}");
    }
}
